package com.mall4jcola.cloud.auth.model;

import cn.hutool.core.util.ObjectUtil;
import lombok.Data;

/**
 * @author hmxchen
 */

@Data
public class UserLoginInfo {
    private Long userId;
    private Integer sysType;
    private UserAuthEntity userAuthEntity;
    private UserInfoEntity userInfoEntity;
    public static UserLoginInfo of(UserAuthEntity userAuthEntity){
        UserLoginInfo userLoginInfo = new UserLoginInfo();
        userLoginInfo.setUserAuthEntity(userAuthEntity);
        return userLoginInfo;
    }
    public Integer getSysType(){
        if(ObjectUtil.isNotEmpty(userInfoEntity)){
            return userInfoEntity.getSysType();
        }
        return null;
    }
    public Long getUserId(){
        if(ObjectUtil.isNotEmpty(userAuthEntity)){
            return userAuthEntity.getUserId();
        }
        return null;
    }
}
